Github CLIを使ってみよう
#inbox
from 自己紹介スライド作成
Github CLIでpushまでやる
gh repo create --private
もしくはpublic
internalが分からない
https://docs.github.com/ja/enterprise-cloud@latest/repositories/creating-and-managing-repositories/about-repositories#about-internal-repositories
ひとまず関係ないので良い
上手く動いてない
code:ddd
% gh repo create --public --source ./self-intro
✓ Created repository custard-1855/self-intro on GitHub
https://github.com/custard-1855/self-intro
X Unable to add remote "origin"
なんで?
https://github.com/cli/cli/issues/7127
読んでもよく分からない
一回消す
code:delete
% gh repo list
Showing 3 of 3 repositories in @custard-1855
NAME DESCRIPTION INFO UPDATED
custard-1855/self-intro public about 13 minutes ago
custard-1855/2024_team... INIADの講義で行った... private about 2 months ago
custard-1855/t-car private about 8 months ago
% gh repo delete self-intro
X Sorry, your reply was invalid: You entered yes
? Type custard-1855/self-intro to confirm deletion: custard-1855/self-intro
✓ Deleted repository custard-1855/self-intro
もう一回作る
同様のエラー
git入れてないせいでは?
gitを入れる
brew install git
https://git-scm.com/downloads/mac
もう一回create
code:recreate
% gh repo create --public --source=./self-intro -r orgin
✓ Created repository custard-1855/self-intro on GitHub
https://github.com/custard-1855/self-intro
✓ Added remote git@github.com:custard-1855/self-intro.git
うまく行った
やっぱりgitが足りなかったのか
下の懸念通りだった
https://docs.github.com/ja/github-cli/github-cli/about-github-cli#コマンド-ラインでの-github-cli-と-git-の違いは何ですか
gitも使わないとうまく作業できないのかも
あくまでgithub上の操作をcliでやろうねという話みたい
リポジトリは作れたがpushできない
git push origin mainでエラー
code:d
% git remote
orgin
origin
作成時にorginにしている
しかもoriginがなぜか最初からある
テンプレートリポジトリから作成していないから?
最初指示の方でテンプレから作れといっていた
それを無視しているのが原因なのでは
--include-all-branches
Include all branches from template repository
これで行けそう
こっちっぽい
-p, --template <repository>
Make the new repository based on a template repository
違いは?
上はテンプレートを含める
下はテンプレートを元に作る
少しの違い?
レポジトリを作りなおす
gh repo create --public --template=being24/latex-template-jaでエラー
name argument required to create new remote repository
と言われる
名前が足りなかったみたい
code: s
% gh repo create --public --template=being24/latex-template-ja self-intro
✓ Created repository custard-1855/self-intro on GitHub
https://github.com/custard-1855/self-intro
やっとできた
https://gyazo.com/d7bd0a75be9569bbb678d2ca09876d43